<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #parent {
            width: 100%;

            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(2, 1fr); /*等同于1fr 1fr 1fr,此为重复的合并写法*/
            grid-template-rows: repeat(2, 1fr);  /*等同于1fr 1fr 1fr,此为重复的合并写法*/
        }
        .item {
            border: 1px solid #000;
            height: 200px;
        }

    </style>
</head>
<body>
<div id="parent">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
    <div class="item">5</div>
    <div class="item">6</div>
    <div class="item">7</div>
    <div class="item">8</div>
    <div class="item">9</div>
</div>

</body>
</html>